import { createStoreBindings } from 'mobx-miniprogram-bindings'
import { userStore } from '../../stores/userstore'
Page({

  /**
   * 页面的初始数据
   */
  data: {
    // 初始化第二个面板数据
    initpanel: [
      {
        url: '/modules/orderPayModule/pages/order/list/list',
        title: '商品订单',
        iconfont: 'icon-dingdan'
      },
      {
        url: '/modules/orderPayModule/pages/order/list/list',
        title: '礼品卡订单',
        iconfont: 'icon-lipinka'
      },
      {
        url: '/modules/orderPayModule/pages/order/list/list',
        title: '退款/售后',
        iconfont: 'icon-tuikuan'
      }
    ]
  },
  toLoginPage () {
    wx.navigateTo({
      url: '/pages/login/login'
    })
  },
  onLoad () {
    this.storeBindings = createStoreBindings(this, {
      store: userStore,
      fields: ['token', 'userInfo'],
      actions: ['setToken', 'setUserInfo']
    })
  },
  onUnload() {
    this.storeBindings.destroyStoreBindings()
  }
  
})